home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
assemblr
/
library
/
ansi
/
nnansi
/
nnansi_d.asm
< prev
next >
Wrap
Assembly Source File
|
1990-10-12
|
9KB
|
275 lines
;---- nnansi_d.asm -----------------
; Definitions for the New New ANSI driver, NNANSI.SYS.
; This version is for EGA/VGA only! Not for CGA or MGA or Hercules
; By Tom Almy
TRUE equ 1
FALSE equ 0
;*************************************************************
;***************** *******************
;***************** User Definable Options *******************
;***************** *******************
;*************************************************************
; Define both of these TRUE is display type is unknown.
; Otherwise define FALSE what your display isn't.
; Note: If display is neither VGA nor EGA, then this driver won't work,
; but the driver will work if you define both of these FALSE.
; This is useful for VGA systems that want the 43 line mode to
; display 50 lines.
VGA equ TRUE ; define TRUE for VGA, defining as FALSE eliminates
; 50 line mode code. (43 line mode will run with 50
; lines like older nansi and nnansi drivers
EGA equ TRUE ; define TRUE for EGA for best results on EGA.
; defining as FALSE eliminates 43 line cursor fix code
; Define one of the following true if you have the appropriate
; display card. Otherwise leave them all FALSE.
VEGA equ FALSE ; Configure for Video-Seven FastWrite VGA, or
; compatible (such as Tatung VGA (not VGA-16))
PARADISE equ FALSE ; Paradise VGA (or EGA)
STBVGA equ FALSE ; STB VGA Extra
TVGA16 equ FALSE ; Tatung VGA-16
EGAWIZ equ FALSE ; EGA Wizard Deluxe
ATT600 equ FALSE ; AT&T VDC600 (untested)
; Define the following TRUE if you have an 8088/6 (PC XT or clone), or might
; want to use the driver with an 8088/6. Define as FALSE for
; processors >=80186 for best performance and smallest size.
cheap_pc equ FALSE ; no fancy instructions if true
; The following options specify certain feature options. These options
; take space if turned on, but improve performance and/or add features.
key_redef equ FALSE ; keyboard redefinition allowed if true
; If you don't use key redefinition, set at FALSE, since some Trojan
; Horse programs take advantage of this. Also it takes space.
init_buf_size equ 256 ; size of keyboard redefinition buffer
; and parameter buffer when key_redef TRUE. You may want to change
; the size, if you use this feature. Don't make it <100.
quick_char equ TRUE ; quick graphic characters in modes 10 and 12
; quick_char should be "TRUE" unless
; you have an incompatible display card.
; And I don't know of any that are.
fast29 equ TRUE ; 15 % faster operation (overall)
; of int29 calls (costs 100 bytes)
bios_write_tty equ TRUE ; take over BIOS write_tty if true
; NOTE: if bios_write_tty is true, the color rendition of text may
; change, but performance will improve and ANSI control codes can
; be used.
gbackground equ TRUE ; generate non-black graphic backgrounds
; This option may cause problems for software not expectings its
; existance. Also you must specify quick_char to use gbackground.
; The following options affect initial state. They do not affect the
; size of the driver.
initgc equ TRUE ; graphics cursor initially on if true
initfast equ TRUE ; initially fast mode if true
; note- you may have to clear the display (CLS command) before
; running some programs, or just before leaving "shell escapes" in
; some programs. But it's typically worth the effort.
; You can disable/enable it with a simple control sequence anyway.
page
; display specific definitions follow. You will need to add to these to
; configure for unsupported displays. Other than that, no user definable
; options follow.
IFE VEGA+PARADISE+STBVGA+TVGA16+EGAWIZ+ATT600 ; default generic graphics.
gmode_test macro isgraphic
; This macro is to jump if display is in an EGA/VGA 16 color
; "compatible" mode -- this means one which is a simple extension
; (more rows and/or columns) than modes 10h or 12h. At minimum
; modes 10h and 12h themselves qualify.
; No registers may be altered.
; Byte location "cs:video_mode" is a copy of byte 40:49H.
cmp cs:video_mode, 10h ; 640x350, 16 color mode
je isgraphic
cmp cs:video_mode, 12h ; 640x480, 16 color VGA mode
je isgraphic
endm
gmode_code macro
; this macro is used to tell if display is in graphics
; mode by looking at the byte 40:49H, which is in
; register AL at the start of the macro.
; It is to set location cs:gmode_flag non-zero if in a graphics mode.
; No registers may be altered.
; *NOTE* users of Paradise and possibly other VGA
; cards will need to modifify this routine because
; Paradise extended character modes set this byte to
; to the value of the mode you selected. Nicer cards
; (Genoa and VEGA, that I know of) leave this byte at
; "3" and all works fine!
mov cs:gmode_flag,0 ; assume character mode (zero flag)
cmp al, 4
jb not_graphics ; modes =>4 are assumed to be graphic
mov cs:gmode_flag,al ; non-zero value
not_graphics:
endm
ENDIF
IF PARADISE
gmode_test macro isgraphic
cmp cs:video_mode, 10h ; 640x350, 16 color mode
je isgraphic
cmp cs:video_mode, 12h ; 640x480, 16 color VGA mode
je isgraphic
cmp cs:video_mode, 58h ; 800x600, 16 color
je isgraphic
endm
gmode_code macro
mov cs:gmode_flag,0 ; assume character mode (zero flag)
cmp al, 4
jb not_graphics ; modes =>4 are assumed to be graphic
cmp al, 54h ; modes 54 and 55 are text!
je not_graphics
cmp al, 55h
je not_graphics
mov cs:gmode_flag,al ; non-zero value
not_graphics:
endm
ENDIF
IF ATT600
gmode_test macro isgraphic
cmp cs:video_mode, 10h ; 640x350, 16 color mode
je isgraphic
cmp cs:video_mode, 12h ; 640x480, 16 color VGA mode
je isgraphic
cmp cs:video_mode, 47h ; 800x600, 16 color
je isgraphic
endm
gmode_code macro
mov cs:gmode_flag,0 ; assume character mode (zero flag)
cmp al, 4
jb not_graphics ; modes >=4 are assumed to be graphic
cmp al, 54h ; modes 54 and 55 are text!
je not_graphics
cmp al, 55h
je not_graphics
mov cs:gmode_flag,al ; non-zero value
not_graphics:
endm
ENDIF
IF STBVGA
gmode_test macro isgraphic
cmp cs:video_mode, 10h ; 640x350, 16 color mode
je isgraphic
cmp cs:video_mode, 12h ; 640x480, 16 color VGA mode
je isgraphic
endm
gmode_code macro
mov cs:gmode_flag,0 ; assume character mode (zero flag)
cmp al, 4
jb not_graphics ; modes >=4 are assumed to be graphic
cmp al, 22h ; modes 22 and 23 are text!
je not_graphics
cmp al, 23h
je not_graphics
mov cs:gmode_flag,al ; non-zero value
not_graphics:
endm
ENDIF
IF TVGA16
gmode_test macro isgraphic
cmp cs:video_mode, 10h ; 640x350, 16 color mode
je isgraphic
cmp cs:video_mode, 12h ; 640x480, 16 color VGA mode
je isgraphic
endm
gmode_code macro
mov cs:gmode_flag,0 ; assume character mode (zero flag)
cmp al, 4
jb not_graphics ; modes >=4 are assumed to be graphic
cmp al, 56h ; modes 56 and 57 are text!
jb not_graphics
cmp al, 57h
jb not_graphics
mov cs:gmode_flag,al ; non-zero value
not_graphics:
endm
ENDIF
IF VEGA
gmode_test macro isgraphic
cmp cs:video_mode, 10h ; 640x350, 16 color mode
je isgraphic
cmp cs:video_mode, 12h ; 640x480, 16 color VGA mode
je isgraphic
cmp cs:video_mode, 14h ; 752x410
je isgraphic
cmp cs:video_mode, 15h ; 720x540
je isgraphic
cmp cs:video_mode, 16h ; 800x600
je isgraphic
endm
gmode_code macro
mov cs:gmode_flag,0 ; assume character mode (zero flag)
cmp al, 4
jb not_graphics ; modes >=4 are assumed to be graphic
mov cs:gmode_flag,al ; non-zero value
not_graphics:
endm
ENDIF
IF EGAWIZ
gmode_test macro isgraphic
cmp cs:video_mode, 10h ; 640x350, 16 color mode
je isgraphic
cmp cs:video_mode, 12h ; 640x480, 16 color VGA mode
je isgraphic
cmp cs:video_mode, 26h ; 640x480, 60 line
je isgraphic
cmp cs:video_mode, 70h ; 740x396
je isgraphic
cmp cs:video_mode, 71h ; 800x600
je isgraphic
endm
gmode_code macro
mov cs:gmode_flag,0 ; assume character mode (zero flag)
cmp al, 4
jb not_graphics ; modes >=4 are assumed to be graphic
cmp al, 22h ; 22-24 are nongraphic
jb is_graphics
cmp al, 24h
jbe not_graphics
cmp al, 32h ; 32-34 are nongraphic
jb is_graphics
cmp al, 34h
jbe not_graphics
cmp al, 38h ; 38 is nongraphic
je not_graphics
is_graphics:
mov cs:gmode_flag,al ; non-zero value
not_graphics:
endm
ENDIF
page
; some remaining declarations
IF key_redef
buf_size equ init_buf_size ; size of parameter/redef buffer
ELSE
buf_size equ 20 ; size of parameter/redef buffer
ENDIF
IF cheap_pc
.8086
ELSE
.286c
ENDIF